<template>




	<view class="uni-swiper-page">
		<view>
			<view class="vi1">
				<view class="vi2">
					<view class="flex-row wrapper">
						<u-image class="im"
							:src="user.picture"
							width="112rpx" height="112rpx" shape="circle"></u-image>
						<view class="flex-col flex-row wraper-col vi3">
							<view class="u-line-1 text">{{user.name}}</view>
							<view class="u-line-1 text-two">产品部/产品经理</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view ref="list" class="list" :offset-accuracy="5" :bounce="true" isSwiperList="true">
			<view class="v1" v-for="(item, index) in dataList" :key="item.id" :ref="'item'+index"
				@click="onclick(item)">
				<view class="list-item">
					<text style="font-size: 18px;margin-left: 10px;">{{item.time}}</text>
				</view>
			</view>

			<view class="loading"></view>
		</view>
	</view>
</template>

<script>
	import res from '@/utils/request.js'
	export default {
		data() {
			return {
				scrollable: true,
				dataList: [],
				user:{}
			}
		},
		created() {
			this.user=uni.getStorageSync('user')
			console.log(this.user)
			//获取用户头像
			uni.request({
				url: "http://localhost:8007/conference/social/getIdPic/"+this.user.eid,
				method: 'get',
				success: (res) => {
					console.log(res)
					this.user.picture = res.data.data.p.picture
					// console.log(this.dataList[0].paytime.)
				}
			})
			
			
				// res({
				// url: "conference/money/findAllMoney",

			uni.request({
				url: "http://localhost:8007/conference/money/findAllMoney/"+this.user.eid,
				method: 'get',
				success: (res) => {
					console.log(res)
					this.dataList = res.data.data.list
					console.log(this.dataList[0].paytime)
					// console.log(this.dataList[0].paytime.)
				}
			})

		},
		methods: {
			setScrollRef(height) {
				if (this.$refs['list'].setSpecialEffects) {
					this.$refs['list'].setSpecialEffects({
						id: this.parentId,
						headerHeight: height
					});
				}
			},
			onclick(e) {

				uni.navigateTo({
					url: "./details?id=" + e.id,

				})

				// uni.request({
				// 	url: "http://localhost:8007/conference/money/getIdMoney/"+e.id,
				// 	method:'get',
				// 	success: (res) =>{
				// 		console.log(res)
				// 		// this.dataList = res.data.data.Money

				// 		console.log(res.data.data.Money)
				// 	}
				// })
				// console.log(e);
			},
			loadData() {
				// 首次激活时被调用
			},
			clear() {
				// 释放数据时被调用，参考 swiper-list 缓存配置
				this.dataList.length = 0;
			}
		}
	}
</script>

<style scoped lang="scss">
	/*  头部开始	  */
	.flex-row {
		display: flex;
		align-items: flex-start;
	}

	.flex-col {
		display: flex;
		align-items: flex-start;
		flex-direction: column;
	}

	.text {
		width: 73px;
		margin-bottom: 14px;
		font-size: 20px;
	}

	.text-two {
		width: 100%;
		font-size: 12px;
	}

	.vi1 {
		width: 91%;
		height: 80px;
		background-color: white;
		margin: 10px 0px 0px 15px;
	}

	.vi2 {
		float: left;
		margin: 15px 0px 0px 20px;
	}

	.vi3 {
		margin: 0px 0px 0px 20px;
	}

	/* 头部结束	 */

	/* ---- */
	.uni-swiper-page {
		flex: 1;
		position: absolute;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
	}

	.list {
		flex: 1;
	}

	.list-item {
		height:10px;
		margin-left: 12px;
		margin-right: 12px;
		margin-top: 12px;
		padding: 35px 0px 35px 20px;
		background-color: #fff;
		border-radius: 5px;
	}

	.loading {
		height: 20px;
	}

	.header {
		height: 160px;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		background-color: #f4f4f4;
	}

	.header-title {
		font-size: 30px;
		font-weight: bold;
		color: #444;
	}
</style>
